package 力扣._11_盛最多水的容器;

public class Solution2 {
    //暴力——但是超时
    public int maxArea(int[] height) {
        int max = 0;
        for (int i = 0, j = height.length - 1; i < j; ) {
            max = Math.max(max, (j - i) * Math.min(height[i], height[j]));
            if (height[i] > height[j])
                j--;
            else
                i++;
        }
        return max;
    }

}
